<template>
  home
  <button @click="getData()">click me</button>
  <ul>
    <li v-for="(item, i) in testData.list" :key="i">{{ item }}</li>
  </ul>
</template>

<script setup>
import { ref, reactive } from "vue"
import API from "../assets/js/axios.js"

const testData = reactive({
  list:[]
});

//测试请求方法
// /test/login.php
const getData = function(){
  API({
      url:'http://127.0.0.142:9001/test/test.php',
      method:'GET'
  }).then((res)=>{
      console.log(res);
      testData.list = res.data;
  }).catch((e)=>{
    console.log(e);
  });

}
</script>

<style scoped>

</style>